package cn.cmeizu.spring6.iocxml.di;

/**
 * @author cmeizu
 * @date 2023/2/8 23:05
 */
public class Book {

  private String bname;
  private String author;

  public String getOther() {
    return other;
  }

  public void setOther(String other) {
    this.other = other;
  }

  private String other;

  public Book() {
  }

  public Book(String bname, String author,String other) {
    System.out.println("有参数构造执行了");
    this.bname = bname;
    this.author = author;
    this.other = other;
  }

  public String getBname() {
    return bname;
  }

  public void setBname(String bname) {
    this.bname = bname;
  }

  public String getAuthor() {
    return author;
  }

  public void setAuthor(String author) {
    this.author = author;
  }

  @Override
  public String toString() {
    return "Book{" +
        "bname='" + bname + '\'' +
        ", author='" + author + '\'' +
        ", other='" + other + '\'' +
        '}';
  }

  public static void main(String[] args) {
    //set方法注入
    Book book = new Book();
    book.setBname("java");
    book.setAuthor("cmeizu");

    //构造方法
    Book book1 = new Book("java", "cmeizu","<>");
  }
}
